
var fs = require('fs')


var schema = require('../config/schema')


for(var k in schema){

    var file = '../toCode/models/' + k + 'Model.js';

    var str = fs.readFileSync('../models/demoModel.txt').toString()

    console.log(str);

    str = str.replace(/#demo#/g, k);

    var Readable = require('stream').Readable;
    var  rs = new Readable;
    rs.push(str);
    rs.push(null);
    
    rs.pipe(fs.createWriteStream(file));


    
}
